import Vue from 'vue';
import App from '@/App.vue';
import store from '@/store';
import router from '@/router';
// import '@/router/router-filter';
import request from '@/axios';
import axios from 'axios';
import components from '@/components'; // 全局组件
import directives from '@/directives'; // 全局指令
import '@/icons'; // svg组件
// import 'mocks/mock'; // 生产环境mock数据

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import { Message } from 'element-ui';

import 'vue-beauty/package/style/vue-beauty.min.css';
import vueBeauty from 'vue-beauty';

import crudCommon from '@/mixins/crud';
window.$crudCommon = crudCommon;

// 引入防抖、节流函数
import { debounce, throttle } from '@/utils/util';
Vue.prototype.$debounce = debounce(function(fnName, ...args) {
  this[fnName](...args);
});
Vue.prototype.$throttle = throttle(function(fnName, ...args) {
  this[fnName](...args);
});

// avue采用CDN的方式引入，方便修改源码来使用
// import AVUE from '@smallwei/avue';
// import '@smallwei/avue/lib/index.css';

Vue.use(ElementUI);
Vue.use(vueBeauty);
Vue.use(AVUE);
Vue.use(components);
Vue.use(directives);

Vue.config.productionTip = false;
Vue.prototype.$axios = axios;
Vue.prototype.$request = request;
Vue.prototype.$message = Message;

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app');
